package JUCModule.src;

public class ThreadLocalTest {
	public static void main(String[] args) {
		ThreadLocal<Integer> threadLocal = new ThreadLocal<>();
		new Thread(
				()->{
					try {
						Thread.sleep(2000);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					System.out.println(threadLocal.get());
				}
		).start();

		new Thread(
				()->{
					try {
						Thread.sleep(1000);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					threadLocal.set(22);
				}
		).start();
	}
}
